package com.zhiyou100.api.object_demo;

import java.util.Date;
import java.util.Objects;

public class Teacher {

    private String name; //姓名
    private int age; //年龄
    private String num;  //编号

    //自动生成的equals
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Teacher teacher = (Teacher) o;
        return age == teacher.age
                && Objects.equals(name, teacher.name)
                && Objects.equals(num, teacher.num);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, num);
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", num='" + num + '\'' +
                '}';
    }

    public Teacher(String name, int age, String num) {
        this.name = name;
        this.age = age;
        this.num = num;
    }

    public Teacher() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }


    public static void main(String[] args) {
        Date date = new Date();

    }


}
